package cn.hp.service.impl;
import cn.hp.entity.DictType;
import cn.hp.mapper.DictTypeMapper;
import cn.hp.service.DictTypeService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class DictTypeServiceImpl implements DictTypeService {
    @Resource
    private DictTypeMapper dictTypeMapper;
    @Override
    public List<DictType> selectDictType(DictType dictType) {
        return dictTypeMapper.selectDictType(dictType);
    }
    @Override
    public PageInfo<DictType> selectDictType(DictType dictType, Integer page,
                                             Integer limit) {
        PageHelper.startPage(page, limit);
        List<DictType> dictTypes = dictTypeMapper.selectDictType(dictType);
        return new PageInfo<>(dictTypes);
    }
    @Override
    public int insertDictType(DictType dictType) {
        return dictTypeMapper.insertDictType(dictType);
    }
    @Override
    public int updateDictType(DictType dictType) {
        return dictTypeMapper.updateDictType(dictType);
    }
    @Override
    public int deleteDictTypeById(Integer id) {
        return dictTypeMapper.deleteDictTypeById(id);
    }
}